Using Linear Positional Grammars for the LR Parsing of 2-D Symbolic Languages

نویسندگان

  • Gennaro Costagliola
  • Shi-Kuo Chang
چکیده

In this paper we present a grammar formalism for the generation and parsing of two-dimensional symbolic languages. Linear Positional Grammars (or LPGs for short) are an immediate generalization of the context-free string grammars. Through the use of general spatial relations they allow the definition of pictures whose symbols span on a two-dimensional space. Due to their analogy to context-free string grammars, LPGs can be used to construct an LR-based parser which uses the spatial relations to navigate the input. We study ambiguous grammars and present several ways to solve them. Moreover we provide an algorithm to translate a linear positional grammar into a contextfree grammar with actions and suggest a general methodology to parse twodimensional symbolic languages by making use of the well-known tool YACC (Yet Another Compiler-Compiler [25]). As an example, we construct a parser for a subset of the two-dimensional arithmetical expression language.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Parsing Methodology for the Implementation of Visual Systems

The Visual Language Compiler-Compiler (VLCC) is a grammar-based graphical system for the automatic generation of visual programming environments. In this paper the theoretical and algorithmic issues of VLCC are discussed in detail. The parsing methodology we present is based on the “positional grammar” model. Positional grammars naturally extend context-free grammars by considering new relation...

متن کامل

Ch(k) Grammars: A Characterization of LL(k) Languages

From the point of view of parsing the LL(K] grammars constitute a very attractive class of context-free grammars. For each LL{K] grammar a top-down parsing algorithm can be devised which is essentially a one-state deterministic push-down automaton. From a more theoretiG point of view LL[K) grammars are attractive as well. It is well-known, for example, that it is decidable whether two LLfk) gra...

متن کامل

An Efficient Context-Free Parsing Algorithm for Natural Languages

This paper introduces an efficient context-free parsing algorithm and emphasizes its practical value in natural language processing. The algorithm can be viewed as an extended LR parsing algorithm which embodies the concept of a "graph-structured stack." Unlike the standard LR, the algorithm is capable of handling arbitrary non cyclic context-free grammars including ambiguous grammars, while mo...

متن کامل

On the Translation of Languages from Left to Right

There has been much recent interest in languages whose grammar is sufficiently simple that an efficient left-to-right parsing algorithm can be mechanically produced from the grammar. In this paper, we define LR(k) grammars, which are perhaps the most general ones of this type, and they provide the basis for understanding all of the special tricks which have been used in the construction of pars...

متن کامل

On Parsing and Condensing Substrings of LR Languages in Linear Time

LR parsers have long been known as being an efficient algorithm for recognizing deterministic context–free grammars. In this article, we present a linear–time method for parsing substrings of LR languages. The algorithm depends on the LR automaton that is used for the usual parsing of complete sentences. We prove the correctness and linear complexity of our algorithm and present an interesting ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Grammars

دوره 2  شماره 

صفحات  -

تاریخ انتشار 1999